/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mrp.productionPlanning.entity;

import crm.salesOrderProcessing.entity.DeliveryOrderEntity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import crm.salesOrderProcessing.entity.SalesOrderEntity;

/**
 *
 * @author Wei Haoyang
 */
@Entity
@DiscriminatorValue("BackorderEntity")
public class BackorderEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dueDate;
    private int demandA;
    private int demandB;
    private int demandC;
    private int demandD;
    private DeliveryOrderEntity deliveryOrder = new DeliveryOrderEntity();
//    private List<DailyDetailEntity> scheduledDays = new ArrayList<DailyDetailEntity>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BackorderEntity)) {
            return false;
        }
        BackorderEntity other = (BackorderEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mrp.entity.BackorderEntity[ id=" + id + " ]";
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public int getDemandA() {
        return demandA;
    }

    public void setDemandA(int demandA) {
        this.demandA = demandA;
    }

    public int getDemandB() {
        return demandB;
    }

    public void setDemandB(int demandB) {
        this.demandB = demandB;
    }

    public int getDemandC() {
        return demandC;
    }

    public void setDemandC(int demandC) {
        this.demandC = demandC;
    }

    public int getDemandD() {
        return demandD;
    }

    public void setDemandD(int demandD) {
        this.demandD = demandD;
    }


//    public List<DailyDetailEntity> getScheduledDays() {
//        return scheduledDays;
//    }
//
//    public void setScheduledDays(List<DailyDetailEntity> scheduledDays) {
//        this.scheduledDays = scheduledDays;
//    }

    /**
     * @return the deliveryOrder
     */
    public DeliveryOrderEntity getDeliveryOrder() {
        return deliveryOrder;
    }

    /**
     * @param deliveryOrder the deliveryOrder to set
     */
    public void setDeliveryOrder(DeliveryOrderEntity deliveryOrder) {
        this.deliveryOrder = deliveryOrder;
    }
    
}
